<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org" >  <!-- thymeleaf追加 -->
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 后台管理员</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>  <!-- vue追加 -->
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>		<!-- vue的AJAX追加 -->
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">  <!-- layui格式使用 -->
  <!-- 自用js函数始 -->
  
  <!-- 自用js函数末 -->
</head>
<body>
	<!-- 工作区域始 --> <!-- 药物管理界面 -->
<div class="layui-fluid">
   <div class="layui-row layui-col-space15">
     <div class="layui-col-md12">
       <div class="layui-card">
        
        
        <!-- 展示 -->
		  <div id="app"> <!-- vue -->
        
          <div class="layui-card-header">修改药品</div>
          <div class="layui-card-body layui-row layui-col-space10">
          
            <div class="layui-col-md7">
              	药品名字<input   v-model="name"  type="text" name="title" placeholder="请输入药品名字" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-col-md7">
             	 药品规格<input  v-model="standard"  type="text" name="title" placeholder="请输入药品规格" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-col-md7">
              	药品详情<input  v-model="specification"  type="text" name="title" placeholder="请输入药品详情" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-col-md7">
              	药品厂商<input  v-model="manufacture"  type="text" name="title" placeholder="请输入药品厂商" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-col-md7">
              	药品价格<input  v-model="price"  type="number" name="title" placeholder="请输入药品价格" autocomplete="off" class="layui-input">
            </div>
            
            </div>
            
            
        	<div class="layui-btn-container" align="center">
              <input type="button" value="修改药品"   @click="modifyMedicine"  class="layui-btn layui-btn-primary">
            </div>   
            
            

               
          </div> <!-- /vue -->
          <!-- /展示 -->
              
          
         </div>
       </div>
      </div>
     </div>
<!-- 工作区域末 -->
<!-- vue -->
    <script>
        var app = new Vue({
            el:"#app",
            data:{
            	id:"[[${info.data.mediId}]]",
                name: "[[${info.data.mediName}]]",
                standard:"[[${info.data.mediStand}]]",
                specification:"[[${info.data.mediSpecification}]]",
                manufacture:"[[${info.data.mediManu}]]",
                price:"[[${info.data.mediPrice}]]",
                list:[]
            },
            methods:{
               
            	modifyMedicine:function(){ 
                    //ajax for axios
                    var that=this;
                    axios.get("http://localhost:8080/modifyMedicine?id="+this.id+"&name="+this.name
                    		+"&standard="+this.standard+"&specification="+this.specification
                    		+"&manufacture="+this.manufacture+"&price="+this.price)
                    .then(function(d){
                        alert(d.data.msg)
                        window.location.href="views/pharmacy/medimanage.html"
                    });  
               }
            }
        });
    
    
    </script>
<!-- vue -->
 <script src="../../../layuiadmin/layui/layui.js"></script>  <!-- layui基础script -->
 <script>
 layui.config({
	    base: '../../../layuiadmin/' //静态资源所在路径
	  }).extend({
	    index: 'lib/index' //主入口模块
	  }).use(['index', 'table'], function(){
	    var table = layui.table;
	  

	  
	  });
</script>  <!-- leyui基础function -->
</body>
</html>